package cn.com.miao.lynx.common.dict.config;

import cn.com.miao.lynx.common.dict.api.RemoteDictService;
import cn.com.miao.lynx.common.dict.aspect.DictAspect;
import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * DictAutoConfig
 *
 * @title: DictAutoConfig
 * @description:
 * @author: dengmiao
 * @create: 2019-12-29 16:49
 **/
@AllArgsConstructor
@ConditionalOnBean(RemoteDictService.class)
@Configuration
public class DictAutoConfig {

    private final RemoteDictService dictService;

    @Bean
    public DictAspect dictAspect() {
        return new DictAspect(dictService);
    }
}
